package com.example.drug.service.impl;


import com.example.drug.domain.Staff;
import com.example.drug.mapper.StaffMapper;
import com.example.drug.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class StaffServiceImpl implements StaffService {

    @Autowired
    private StaffMapper staffMapper;

    @Override
    public List<Staff> selectAllStaffs() {
        return staffMapper.selectAllStaffs();
    }

    @Override
    public List<Staff> selectStaffByParam(String staffName) {
        return staffMapper.selectStaffByParam(staffName);
    }

    @Override
    public Staff selectStaffById(Long id) {
        return staffMapper.selectStaffById(id);
    }

    @Override
    public boolean insertStaff(Staff staff) {
        return staffMapper.insertStaff(staff) > 0;
    }

    @Override
    public boolean updateStaff(Staff staff) {
        return staffMapper.updateStaff(staff) > 0;
    }

    @Override
    public boolean deleteStaffById(Long id) {
        return staffMapper.deleteStaffById(id) > 0;
    }
}